package com.caesar.exer2;

/**
 * @author caesar
 * @date 2025/7/21
 * @Description:
 * @apiNote
 */
public class TestChatThread {
    public static void main(String[] args) {
        ChatThread t1 = new ChatThread();
        for (int i = 1; i <= 10; i++) {
            System.out.println(i);
            try {
                t1.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (i == 5) {
                t1.start();
                try {
                    t1.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
